package com.nervous.jiaoli.user.login.impl;

import com.nervous.jiaoli.user.login.LoginDto;
import com.nervous.jiaoli.user.login.LoginService;
import com.nervous.jiaoli.user.login.dao.LoginDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service // 说明这是一个受Spring容器管理的业务组件（Bean）
@Transactional // 说明本类的所有方法都是事务性的
public class LoginServiceImpl implements LoginService {
    @Resource
    private LoginDao loginDao;

    @Override
    public boolean checkLogin(LoginDto dto) {
        int cnt = loginDao.findUserCntIdAndPwd(dto);
        return cnt == 1;
    }
}
